package com.fd.spring.controller;

import com.fd.spring.service.UserService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

@Controller
@Data
@Scope(scopeName = "prototype")
public class UserController {
    @Autowired
    private UserService userService;
    @Value("朱老八是大傻逼")
    private String name;

    public UserController() {
        ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext-ann.xml");
        UserService userService = app.getBean("userService", UserService.class);
    }
}
